package com.cusc.module_login.adapter;

import android.content.Context;

import androidx.databinding.ObservableArrayList;

import com.cusc.lib_api.bean.login.MainBean;
import com.cusc.module_login.R;
import com.cusc.module_login.databinding.AdapterFunctionItemBinding;
import com.tcgroup.phone.base_core.adapter.BaseBindAdapter;

/**
 * 作者: wangfei
 * 创建时期: 2020/3/26.
 * 包名: com.cusc.module_login.adapter
 * 类名: OSAndroidMvvm
 */
public class FunctionAdapter extends BaseBindAdapter<MainBean, AdapterFunctionItemBinding> {


    public FunctionAdapter(Context context, ObservableArrayList<MainBean> items) {
        super(context, items);
    }

    @Override
    protected int getLayoutItemId(int viewType) {
        return R.layout.adapter_function_item;
    }

    @Override
    protected void onBindItem(AdapterFunctionItemBinding binding, MainBean item, int position) {
        binding.setModel(item);
        binding.getRoot().setOnClickListener(v -> {
            mItemClickListener.onItemClick(item,position,1);
        });
    }
}
